import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, unref } from "vue";
const _hoisted_1 = ["d"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Arrow",
  props: {
    points: null,
    fill: null,
    stroke: null
  },
  setup(__props) {
    const props = __props;
    const arrowTailHeightRatio = 0.5;
    const arrowSideOffsetRatio = 1 / 8;
    const d = computed(() => {
      const points = props.points;
      const arrowHeight = points[4].y - points[0].y;
      const arrowWidth = points[2].x - points[0].x;
      const arrowTailHeight = arrowHeight * arrowTailHeightRatio;
      const p0 = { x: points[0].x, y: points[0].y + (arrowHeight - arrowTailHeight) / 2 };
      const p1 = { x: points[1].x + arrowWidth * arrowSideOffsetRatio, y: p0.y };
      const p2 = { x: p1.x, y: points[1].y };
      const p3 = { x: points[3].x, y: points[3].y };
      const p4 = { x: p1.x, y: points[5].y };
      const p5 = { x: p1.x, y: p0.y + arrowTailHeight };
      const p6 = { x: points[0].x, y: p5.y };
      const pathPoints = [p0, p1, p2, p3, p4, p5, p6];
      const dArr = [];
      pathPoints.forEach((p) => {
        dArr.push(`${p.x} ${p.y}`);
      });
      const d2 = "M" + dArr.join("L") + "Z";
      return d2;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("path", {
        stroke: "#000000",
        style: normalizeStyle({
          "stroke-width": 1,
          fill: __props.fill || "#ffffff",
          stroke: __props.stroke || "#000000"
        }),
        d: unref(d)
      }, null, 12, _hoisted_1);
    };
  }
});
export { _sfc_main as default };
